package com.lagou.sqlSession;

import com.lagou.pojo.MappedStatement;
import java.util.List;

public interface SqlSession {

    /**
     * 查询所有
     */
    public <E> List<E> selectList(MappedStatement mappedStatement,Object... params) throws Exception;

    /**
     * 根据条件查询单个
     * @param mappedStatement
     * @param params
     * @param <T>
     * @return
     * @throws Exception
     */
    public <T> T selectOne(MappedStatement mappedStatement,Object... params) throws Exception;

    /**
     * 根据条件删除
     * @param mappedStatement
     * @param params
     * @return
     */
    int delete(MappedStatement mappedStatement,Object... params) throws Exception;

    /**
     * 根据条件更新
     * @param mappedStatement
     * @param params
     * @return
     */
    int update(MappedStatement mappedStatement,Object... params) throws Exception;

    /**
     * 为Dao接口生成代理实现类
     */
    public <T> T getMapper(Class<?> mapperClass);


}
